package cn.jinjimi.app.main.widget.biz;

import android.content.Context;
import android.view.LayoutInflater;
import android.widget.RelativeLayout;
import android.widget.TextView;

import cn.jinjimi.base.util.AndroidUtils;
import cn.jinjimi.base.util.ViewUtils;
import cn.jinjimi.app.R;

/**
 * Created by linlongjie
 * Date: 2017/5/20
 */

public class MeEmptyView extends RelativeLayout {

    public MeEmptyView(Context context) {
        this(context, 0);
    }

    public MeEmptyView(Context context, int height) {
        super(context);
        LayoutInflater.from(getContext()).inflate(R.layout.item_me_no_data_layout, this);
        ViewUtils.setSize(this, AndroidUtils.getWindowWidth(context), height);
    }

    public void setSize(int width, int height) {
        ViewUtils.setSize(this, width, height);
    }

    public void setHeight(int height) {
        ViewUtils.setSize(this, AndroidUtils.getWindowWidth(getContext()), height);
    }

    public void setEmptyContent(String content) {
        TextView tvEmpty = (TextView) findViewById(R.id.tv_empty);
        tvEmpty.setText(content);
    }
}
